home *** CD-ROM | disk | FTP | other *** search
/ Champak 40 / Vol 40.iso / games / ufo_comm.swf / scripts / frame_146 / DoAction.as
Encoding:
Text File  |  2007-04-25  |  7.6 KB  |  253 lines

  1. var ┬º\x01┬º = 26;
  2. while(true)
  3. {
  4.    if(eval("\x01") == 26)
  5.    {
  6.       set("\x01",eval("\x01") + 576);
  7.       ┬º┬ºpush(true);
  8.    }
  9.    else
  10.    {
  11.       if(eval("\x01") == 581)
  12.       {
  13.          set("\x01",eval("\x01") + 191);
  14.          _root.level = 4;
  15.          _root.primaData = true;
  16.          _root.ufo.swapDepths(999);
  17.          _root.life = 100;
  18.          _root.lifeBar.gotoAndStop(_root.life);
  19.          _root.lifeText = _root.life + "%";
  20.          _root.oiRapite = 0;
  21.          _root.smokeDepth = 500;
  22.          _root.speedX = 0;
  23.          _root.speedY = 0.7;
  24.          _root.accel = 1;
  25.          _root.counterPozitii = 0;
  26.          _root.beamCounter = 0;
  27.          _root.beamOpen = false;
  28.          _root.rotation = false;
  29.          _root.float = false;
  30.          h = 1;
  31.          while(h <= 4)
  32.          {
  33.             _root.attachMovie("rosu" + h,"rosu" + h,_root.getNextHighestDepth());
  34.             _root["rosu" + h]._alpha = 0;
  35.             h++;
  36.          }
  37.          _root.onEnterFrame = function()
  38.          {
  39.             if(ok)
  40.             {
  41.                _root.lifeText = _root.life + "%";
  42.                _root.ufo._x += _root.speedX;
  43.                _root.ufo._y += _root.speedY;
  44.                _root.rotatie = _root.ufo._rotation;
  45.                if(Key.isDown(37))
  46.                {
  47.                   _root.rotation = false;
  48.                   if(_root.speedX > -3)
  49.                   {
  50.                      if(_root.counterPozitii == 0)
  51.                      {
  52.                         _root.ufo.ufo2.ufo3.gotoAndPlay("apasatS");
  53.                      }
  54.                      _root.counterPozitii = 1;
  55.                      _root.speedX -= _root.accel;
  56.                      if(!_root.beamOpen && _root.ufo._rotation > -12)
  57.                      {
  58.                         _root.ufo._rotation -= 1;
  59.                      }
  60.                   }
  61.                }
  62.                if(Key.isDown(39))
  63.                {
  64.                   _root.rotation = false;
  65.                   if(_root.speedX < 3)
  66.                   {
  67.                      if(_root.counterPozitii == 0)
  68.                      {
  69.                         _root.ufo.ufo2.ufo3.gotoAndPlay("apasatD");
  70.                      }
  71.                      _root.counterPozitii = 1;
  72.                      _root.speedX += _root.accel;
  73.                      if(_root.beamOpen == false && _root.ufo._rotation < 12)
  74.                      {
  75.                         _root.ufo._rotation += 1;
  76.                      }
  77.                   }
  78.                }
  79.                if(Key.isDown(38))
  80.                {
  81.                   if(_root.speedY > -3)
  82.                   {
  83.                      if(_root.counterPozitii == 0)
  84.                      {
  85.                         _root.ufo.ufo2.ufo3.gotoAndPlay("apasatSus");
  86.                      }
  87.                      _root.counterPozitii = 1;
  88.                      _root.speedY -= _root.accel;
  89.                   }
  90.                }
  91.                if(Key.isDown(40))
  92.                {
  93.                   if(_root.speedY < 3)
  94.                   {
  95.                      if(_root.counterPozitii == 0)
  96.                      {
  97.                         _root.ufo.ufo2.ufo3.gotoAndPlay("apasatJos");
  98.                      }
  99.                      _root.counterPozitii = 1;
  100.                      _root.speedY += _root.accel;
  101.                   }
  102.                }
  103.                if(Key.isDown(32))
  104.                {
  105.                   if(_root.ufo._rotation == 0)
  106.                   {
  107.                      if(_root.beamCounter == 0)
  108.                      {
  109.                         _root.ufo.raza.gotoAndPlay(2);
  110.                         _root.beamCounter = 1;
  111.                      }
  112.                   }
  113.                }
  114.                if(_root.speedX < 0)
  115.                {
  116.                   if(_root.ufo._rotation < 0 && _root.rotation == true)
  117.                   {
  118.                      _root.ufo._rotation = _root.ufo._rotation + 1;
  119.                   }
  120.                   _root.speedX += 0.2;
  121.                   if(_root.speedX >= 0)
  122.                   {
  123.                      _root.speedX = 0;
  124.                      _root.ufo.ufo2.ufo3.gotoAndStop(1);
  125.                      _root.ufo._rotation = 0;
  126.                   }
  127.                }
  128.                if(_root.speedX > 0)
  129.                {
  130.                   if(_root.ufo._rotation > 0 && _root.rotation == true)
  131.                   {
  132.                      _root.ufo._rotation--;
  133.                   }
  134.                   _root.speedX -= 0.2;
  135.                   if(_root.speedX <= 0)
  136.                   {
  137.                      _root.speedX = 0;
  138.                      _root.ufo.ufo2.ufo3.gotoAndStop(1);
  139.                      _root.ufo._rotation = 0;
  140.                   }
  141.                }
  142.                if(_root.speedY < 0)
  143.                {
  144.                   _root.speedY += 0.2;
  145.                   if(_root.speedY >= 0)
  146.                   {
  147.                      _root.speedY = 0.7;
  148.                   }
  149.                }
  150.             }
  151.             else
  152.             {
  153.                _root.ufo._y -= 5;
  154.                _root.ufo._alpha -= 5;
  155.             }
  156.          };
  157.          if(_root.primaData)
  158.          {
  159.             _root.attachMovie("d" + _root.level,"d" + _root.level,93);
  160.          }
  161.          _root.d1._x = 405;
  162.          _root.d1._y = 257;
  163.          _root["d" + _root.level]._x = 226;
  164.          _root["d" + _root.level]._y = 303;
  165.          _root.removeArray = new Array();
  166.          _root.removeArray = ["o1","o2","o3","o4","o5","ufo","ufo2","poarta"];
  167.          _root.semneArray = new Array();
  168.          _root.semneArray = ["!","?","*","#"];
  169.          _root.starArray = new Array();
  170.          _root.starArray = ["s4","s4","s4","s4"];
  171.          listener = new Object();
  172.          listener.onKeyUp = function()
  173.          {
  174.             if(Key.getCode() == 37 || Key.getCode() == 38 || Key.getCode() == 39 || Key.getCode() == 40)
  175.             {
  176.                _root.ufo.ufo2.ufo3.play();
  177.                _root.counterPozitii = 0;
  178.                _root.rotation = true;
  179.             }
  180.             if(Key.getCode() == 32)
  181.             {
  182.                _root.ufo.raza.play();
  183.             }
  184.          };
  185.          Key.addListener(listener);
  186.          _root.oiCounter = 30;
  187.          _root.smokeCounter = 3500;
  188.          _root.starCounter = 3500;
  189.          _root.oiTarget = 3;
  190.          _root.oiPeScena = 3;
  191.          stop();
  192.          break;
  193.       }
  194.       if(eval("\x01") == 87)
  195.       {
  196.          set("\x01",eval("\x01") + 690);
  197.          break;
  198.       }
  199.       if(eval("\x01") == 906)
  200.       {
  201.          set("\x01",eval("\x01") - 487);
  202.          break;
  203.       }
  204.       if(eval("\x01") == 419)
  205.       {
  206.          set("\x01",eval("\x01") + 52);
  207.          ┬º┬ºpush(true);
  208.       }
  209.       else if(eval("\x01") == 704)
  210.       {
  211.          set("\x01",eval("\x01") - 566);
  212.          if(┬º┬ºpop())
  213.          {
  214.             set("\x01",eval("\x01") + 443);
  215.          }
  216.       }
  217.       else if(eval("\x01") == 777)
  218.       {
  219.          set("\x01",eval("\x01") - 73);
  220.          ┬º┬ºpush(true);
  221.       }
  222.       else if(eval("\x01") == 602)
  223.       {
  224.          set("\x01",eval("\x01") + 304);
  225.          if(┬º┬ºpop())
  226.          {
  227.             set("\x01",eval("\x01") - 487);
  228.          }
  229.       }
  230.       else
  231.       {
  232.          if(eval("\x01") != 471)
  233.          {
  234.             if(eval("\x01") == 138)
  235.             {
  236.                set("\x01",eval("\x01") + 443);
  237.                break;
  238.             }
  239.             if(eval("\x01") == 772)
  240.             {
  241.                set("\x01",eval("\x01") - 772);
  242.             }
  243.             break;
  244.          }
  245.          set("\x01",eval("\x01") - 384);
  246.          if(┬º┬ºpop())
  247.          {
  248.             set("\x01",eval("\x01") + 690);
  249.          }
  250.       }
  251.    }
  252. }
  253.